"""检查数据库表结构"""
from database import engine
from sqlalchemy import inspect, text

inspector = inspect(engine)

print("=" * 50)
print("数据库表列表:")
print("=" * 50)
for table in inspector.get_table_names():
    print(f"✓ {table}")

print("\n" + "=" * 50)
print("users 表字段:")
print("=" * 50)
for col in inspector.get_columns('users'):
    print(f"{col['name']:20} {col['type']}")

print("\n" + "=" * 50)
print("users 表索引:")
print("=" * 50)
for idx in inspector.get_indexes('users'):
    print(f"{idx['name']} - {idx['column_names']}")

